home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / graphics / 3dvect30.arj / README.DOC < prev    next >
Text File  |  1993-11-18  |  30KB  |  577 lines

  1.  
  2.                           3d Vectors Source 3.0
  3.  
  4.    Date of release - Dec 1/93
  5.  
  6.    Written by: John McCarthy
  7.                1316 Redwood Lane
  8.                Pickering, Ontario.
  9.                Canada, Earth, Milky Way (for those out-of-towners)
  10.                L1X 1C5
  11.  
  12.    Internet/Usenet:  BRIAN.MCCARTHY@CANREM.COM
  13.            Fidonet:  Brian McCarthy 1:229/15
  14.      RIME/Relaynet: ->CRS
  15.  
  16.    Home phone, (416) 831-1944, don't call at 2 am eh!
  17.  
  18.                 ^^^ has been changed to (905) 831-1944!!!
  19.  
  20.    God, this package is getting big...
  21.  
  22.    Routines to be used by all for anything, just send me  a  copy  of  what
  23.    you've accomplished (final product), or at least send me a postcard from
  24.    someplace near where you live.
  25.  
  26.    Many thanks to: Razor - for providing source for their demo.  This  gave
  27.                    me the idea of how to draw polygons in the first place.
  28.  
  29.                    Mode X routines - Matt Pritchard
  30.  
  31.                    Protected Mode Header - Tran
  32.  
  33.                    Bitmap X-mode Scaling routine - John A. Slagel
  34.  
  35.                    Technical support - Robin Ward
  36.                    (in no defined      Danny Hawrysio
  37.                        order)          Robert Johnston
  38.                                        Ciaran Gultniers
  39.                                        Mark Rostek
  40.                                        Shawn Knight
  41.                                        Sebastian Dwornik
  42.                                        Adam Kurzawa
  43.                                        Adam Johns
  44.                                        Ciaus Tenche
  45.                                        Peter Gruhn
  46.                                        Sean Palmer
  47.                                        Alan Illeman
  48.                                        Rob Czuppon
  49.  
  50.                    Food provided by - My Mommy
  51.  
  52.   As noted above, this file would not  be  possible  without  other  people
  53.   giving away their source code.  I continue the tradition of "knowledge is
  54.   power" and give this away.  Most people who see this will never do a damn
  55.   thing with it but look at it and say "uh, so, what next?" so I don't want
  56.   you to register or anything dumb like that.  By the way, people who  want
  57.   money for crappy shareware progs can rot in hell.  But if you do  make  a
  58.   commercial game, and make billions, at least  send  me  a  postcard  from
  59.   the Bahamas ok!  Like I'm not going  to   refuse  a  cheque if  you  make
  60.   something commercial, but like I said, only 1 in a million  may  actually
  61.   have the time/effort/patience/guts/brains to make a commercial game.
  62.  
  63.   The original Mode X routines have been  modified   to  support  protected
  64.   mode.  Many thanks Matt Pritchard for the X-Mode knowledge.  I  hope  you
  65.   don't mind my changing your routines.  Matt Pritchard can be  reached  at
  66.   P.O. Box 140264, Irving, TX  75014  USA.
  67.  
  68.   The protected mode header has been supplied by TRAN and can be reached on
  69.   Sound Barrier BBS (718)979-6629.  I have included all of TRANs  protected
  70.   mode package because I really hate getting code from  someplace  and  not
  71.   getting the support for it.  I make no claim  to  any  of  this  code,  I
  72.   simply want to supply you with all the info to effectively work with this
  73.   3d vector package.  TRAN implies that you can reach him  on  internet  at
  74.   tran@phantom.com
  75.  
  76.   The bitmap scale routine has been supplied by John A. Slagel.  Thanks  to
  77.   you as  well  where  ever  you  are.   The  scale  routine  now  supports
  78.   transparent bitmapping.  As of this writing, John  A.  Slagel's  internet
  79.   access has been canceled and I have no other address for him.
  80.  
  81.   If you want the original non-protected mode Vector  routines, I  can  dig
  82.   them up for you if you send me a  disk  or  something.   But  first,  ask
  83.   yourself, "Why would anyone want to  go back to  segmented  coding?"   If
  84.   you still want those  routines, hit  self  on  head  with  nearest  blunt
  85.   object and re-ask question.  (Many thanks TRAN)
  86.  
  87.   Routines are heavily optimized for 3d  vectors.   Any  code/routine  that
  88.   slow is not intended to be used with animation and has  been  written  to
  89.   simply get the job done.  You will know which routines are slow/fast once
  90.   you look at the code.
  91.  
  92.   I don't apologize for the lack  of  effective  documentation  or  example
  93.   programs as this code was written for my own use.  I would like to  spend
  94.   more time writing code than writing docs.  I also don't apologize for the
  95.   lack of universality of code execution.  For example, Matts xmode code is
  96.   callable from C but mine isn't.  Some of the routines must have registers
  97.   set up before entry and some require memory to be set up.  U figure which
  98.   is which.  It usually says at the begining of the routine.   Once  again,
  99.   making  everything callable from C slows things down  and  this is what I
  100.   wanted to avoid.  Speed is the key considering it is for my own use.
  101.  
  102.   You must have a 386 to run this.  If you only have a 286, get a  job  and
  103.   buy a real machine!
  104.  
  105.   Also, I really hate people who give away their "source" code but actually
  106.   only give away the object file.  If these people are so embarassed  about
  107.   their crappy code then we don't want your crappy object file.  Give  away
  108.   all or nothing.
  109.  
  110.   It would be really nice if I got a postcard from some place near where you
  111.   live.
  112.  
  113.     Some files in this zip:
  114.  
  115.       main.asm      ; example program to show vectors
  116.       3d1.asm       ; 3d vector routines by John McCarthy, fast sort method
  117.       3d2.asm       ; 3d vector routines by John McCarthy, full sort method
  118.       xmode.asm     ; xmode routines by Matt Pritchard
  119.       xmouse.asm    ; xmode/protected mode mouse routines
  120.       pmode.asm     ; protected mode routines by TRAN
  121.       file.asm      ; pmode file routines by TRAN
  122.       argc.asm      ; command line argument scanner by TRAN
  123.       stars.asm     ; plot stars
  124.       font.asm      ; screen setup routines
  125.  
  126.       xmode.inc     ; files defining externals for linkage
  127.       xmouse.inc    ; with above asm files
  128.       pmode.inc     ; example: if you want to use some routines/data
  129.       3d.inc        ; from xmode.asm, use:include xmode.inc
  130.       file.inc
  131.       argc.inc
  132.       stars.inc
  133.       font.inc
  134.  
  135.       xscale.inc    ; bitmap scaling routines
  136.       math.inc      ; math functions for 3d.asm
  137.       sin.inc       ; data tables for math functions: math.inc
  138.       arctan.inc    ; inverse tan function tables: math.inc
  139.       vars1/2.inc   ; variables for 3d.asm routine
  140.       equ.inc       ; list of constants
  141.       shading.inc   ; arctan shading table
  142.  
  143.       macros.inc    ; macros used throughout
  144.  
  145.       qb.zip        ; qb quickbasic programs to generate sin and arctan tables
  146.       modex104.zip  ; (some of the) original files from Matt's modex104.zip
  147.  
  148.   Some bugs fixed for 2.1:
  149.  
  150.     Mouse routine draw_bitmap fixed (start of bitmap is x and y). Fixes crash
  151.  
  152.     Also, the mouse resolution has been divided by two to stop that dang  two
  153.     pixel movement!
  154.  
  155.     Many bugs fixed in Xmode.asm conversion from segmented mode to protected
  156.     mode.  Too many protected mode bug fixes to list.
  157.  
  158.     Also added some palette fading routines to xmode.asm
  159.  
  160.     The big change is the new method of  sorting  surfaces.   Before,  objects
  161.     were sorted first, then surfaces within objects were sorted.  Now, drawing
  162.     an object simply draws the surfaces in   memory   and  then  ALL  surfaces
  163.     are sorted as a group.  This now allows small objects to go inside  larger
  164.     objects.  This is not possible in 3d1,  small objects will disappear.  The
  165.     3d1 file is faster but the 3d2 file has greater flexability with  objects.
  166.     The old file is 3d1.asm while the full sorting file  is  3d2.asm.  To  use
  167.     you must call sort_list and drawvect after makeobjs (if using  3d2  -  the
  168.     full sort method).  See main1 and main2 for examples.   To  give  you  the
  169.     speed difference between the two, the calculation for a   bubble  sort  is
  170.     (n^2+n)/2 for number of times routine will sort.  In 3d1 - 30 objects with
  171.     30 sides will take 465 sorts * 30 objects + 465 to sort those  objects  is
  172.     =  14,415  loops.   But  3d2  uses  the  basic  30*30  sorts.   Therefore,
  173.     (900^2+900)/2 = 405,450 loops!  You can use 3d2 in portions and still  get
  174.     the speed of 3d1 if you know certain objects will be far or near (eg  land
  175.     scapes and stars are always far) and this can provide you with  the  speed
  176.     and versatility of objects going inside one another.  The only  difference
  177.     between 3d1 and 3d2 is the sort method - full objects then surfaces (3d1),
  178.     or all surfaces together (3d2).
  179.  
  180.     Also made it possible to now have points (single dots) and  bitmaps  as
  181.     part of an object.  You no longer need to make a bitmap it's own object
  182.     but can now have it as part of another object.  It is still possible to
  183.     have bitmaps as their own objects (for explosions and bullets).     See
  184.     sphered cube and regular sphere in example file.
  185.  
  186.   Optimizations for 3dvect22:
  187.  
  188.     Better make1obj routine  now  uses  ematrix  more  efficeintly  by  only
  189.     calculating matrix x,y and z as needed - makes better use  of  cpu  time
  190.     when there are many objects off screen (behind camera or too far lft/rgt
  191.     up/dwn)
  192.  
  193.     Added more math functions
  194.  
  195.     Optimized erotate when usez = no
  196.  
  197.   Changes for 3dvect23:  Aug 10/93
  198.  
  199.     Implemented new pmode.asm code by TRAN.  This replaces the  start32  code
  200.     and allows 3dvect to be run with memory managers like HIMEM  and  EMM386.
  201.     Many thanks to TRAN!  Note: Maximum speed is still found with  no  memory
  202.     managers - ei. raw memory.  Change all int 30h's to int 33h's.
  203.  
  204.     Removed some common routines from 3d1 and 3d2 and put them in poly.inc to
  205.     avoid duplicate copies of routines.
  206.  
  207.     Also added to xmode.asm routines to turn off the screen to stop flicker
  208.     when changing into xmode
  209.  
  210.     Updated TGA2ICON program so it will function with the new pmode header
  211.     and can operate with those nasty memory managers.
  212.  
  213.     I am currently writing this from my living room floor where I  have  been
  214.     laying for the last month due to a herniated disc in my lower back - fun!
  215.  
  216.   Additions for 3dvect24:  Aug 29/93
  217.  
  218.     The main addition for version 2.4 is the IRQ  routine  that  co-ordinates
  219.     itself  with  the  routine  updvectors.   The  IRQ  increments  the  byte
  220.     traces_past every time a vertical retrace occures  (regardless  of   what
  221.     the vector routines are doing) and the routine updvectors (get it, up the
  222.     vectors - d=the, like the poor people say) anyway, updvectors  uses  this
  223.     value to make the objects/animation "jump" ahead and  skip  frames.   the
  224.     slower the computer or the greater number of objects  there  are  on  the
  225.     screen, the higher the value  traces_past  will  be  after  updating  the
  226.     screen.  Therefore, if you write your own game/animation, use this  value
  227.     to determine how fast the game should go - the IRQ is timed to match  the
  228.     vertical retrace so every time one passes by, traces_past gets +1. I have
  229.     two interrupts - a protected mode IRQ and a real mode IRQ. I did it  this
  230.     way so that if you want to add music or whatever, you can use either type
  231.     of IRQ.  Both add 1 to traces_past.  Also, I have timed  the  IRQ  to  be
  232.     close to the vertical retrace time but I don't know if  I  have  done  it
  233.     correctly.  If you notice that the out dx,al is not the way to  go  about
  234.     it, drop me a line with the correct method of  setting  the  8253  timer.
  235.     The value of traces_past will be from 1 to whatever (never 0 after trace)
  236.  
  237.     I also fixed a small bug in the updvectors routine - which is now  called
  238.     updvectors2, called by "updvectors".
  239.  
  240.     I have also had a back operation to fix that herniated disc  and  am  now
  241.     sitting upright at my computer.  So I have this message for you:  Sit  up
  242.     straight at all occasions, bend from the knees, get two  people  to  lift
  243.     a heavy object, don't be macho,stand straight at all times,walk straight,
  244.     don't slouch when driving, don't over excercise, don't prop your head  up
  245.     with your arm when watching TV, (put adjective here) straight.  TAKE CARE
  246.     OF YOUR AMAZING MOTION MACHINE - YOUR BACK.   Learn  the  easy  way  from
  247.     someone who learnt the hard way - we're not invincible. STRAIGHT STRAIGHT
  248.     STRAIGHT! STRAIGHT! STRAIGHT! STRAIGHT! There, I'm done.
  249.  
  250.   Some bugs fixed for 2.5:
  251.  
  252.     Fixed the timer IRQ to have OUT 43h,AL (You'll never know the  difference
  253.     but I thought it would be a nice gesture)
  254.  
  255.     I have also ripped a routine from someplace else  to  time  the  vertical
  256.     retrace and set the irq to this value.  This replaces the static variable
  257.     with a more accurate calculation for each computer's irq timing.
  258.  
  259.     I also added a total retrace counter called "frame_number"  which  counts
  260.     from the begining of any animation so you can, let's say at  2.5  minutes
  261.     into it, perform a certain function.  The  counter  is  only  reset  when
  262.     reset_raster_count is called (begining of new animation sequence).
  263.  
  264.     I have also changed the math routine setsincose so that if  you  are  not
  265.     using z rotations, you won't need to reset eyeaz to 0.  (Can be anything)
  266.     This really doesn't increase speed much though.
  267.  
  268.     I optimized some of the imuls with a pre-calculated table. Just to remind
  269.     you:  Changing  video  modes  can occure within the program, but you  can
  270.     only change the vertical size, not the horizontal size (eg  swap  between
  271.     320x400 mode and 320x200 mode, or 360x480 mode   and  360x240  mode)  You
  272.     would only need to adjust the clipping limits and the make3d constants to
  273.     change modes while the program is  executing.   Re-assembley   would   be
  274.     required if you wanted to change into a different x-width mode.
  275.  
  276.     Fixed the xmouse.asm routine plot_mouse.  It was  not  using  an  earlier
  277.     xmode bitmap change.
  278.  
  279.     Robert Johnston now has the correct spelling to his name.
  280.  
  281.     By the way, the mouse is supposed to look like  that!   Call   plot_mouse
  282.     without any page flipping if you want a regular mouse that remembers what
  283.     is behind it.
  284.  
  285.   Help required for 2.6:
  286.  
  287.     I am having a problem with assembleys>65536 bytes.  A description  should
  288.     be found at the bottom of main1.asm. Call me voice of you know how to fix
  289.     it.  Heck, if you know how to fix it, call  today.   Note:Sept 26,problem
  290.     solved!
  291.  
  292.   Additional .asm files for 2.7:
  293.  
  294.     A file has been added to put stars in  the  background.   Stars.asm  only
  295.     calculates the positions of stars that will be on or close to the screen.
  296.     The routine has two assembley modes - full stars or half stars.  The half
  297.     stars mode plots stars that are above the 0y axis.  This allows  you   to
  298.     have a flat surface (airfield/horizon) without calculating the  positions
  299.     of stars below the screen.  The routine is called show_stars.
  300.  
  301.     I have added a macro to the file macros.inc to multiply  by  a  constant.
  302.     The macro is used as cmul result, value, constant.  eg  cmul eax,ecx,320.
  303.     Only  some values are supported but this will change  as  more  constants
  304.     are required.  This replaces a few lines of code in the  make3d  routines
  305.     so ratiox and ratioy imul's can be used by the user (you) without  having
  306.     to import the code from math.inc.  I  also  fixed  a  tini-eeni-wini  bug
  307.     in the non-fast imul routine - not that you care or anything...
  308.  
  309.     God, I can't wait to get a 586...
  310.  
  311.     I have also solved (?) the problem with files>64k not working,I have made
  312.     all 16 bit indexes to 32 bit indexes. The only remaining problem/drawback
  313.     is that the linking order must be such that the irq assembley follows the
  314.     protected mode header, eg: TLINK /3 pmode irq xx xxx xx xx.  I don't know
  315.     why the irq stuff doesn't work if is in the>64k block, maybe  because  it
  316.     has 16 bit real mode code in it or something, who knows...Just link it as
  317.     I have and you can do anything else you want in the 32 bit code  segment.
  318.  
  319.     Because of  the  above,  I  have  moved  the  variables  traces_past  and
  320.     frame_number from 3d.asm to irq.asm. If you need the computer speed/frame
  321.     speed, you will have to have irq.inc in your assembley.  Don't  look  for
  322.     these variables in vars1.inc or vars2.inc anymore, they have  been  moved
  323.     to irq.asm.
  324.  
  325.     Removed more common routines from 3d1 and 3d2 and put them in poly.inc.
  326.  
  327.     John says hi to Sebastian...
  328.  
  329.   Optimizations for 2.8:
  330.  
  331.     Stars routine runs a tad faster.
  332.  
  333.     A better method of moving that cube at the end of main1 example has  been
  334.     implemented (set counter and xadds).   This  main1  and  main2  are  just
  335.     example files to show some of the features.
  336.  
  337.   Additions for 2.9: Sept 28,'93
  338.  
  339.     I just had a brainstorm on how to calculate the 3d stars considering  the
  340.     stars  are  at  a  constant  distance  from  the  camera.   The  variable
  341.     perfect_stars has been added to allow the stars routine to calculate  non
  342.     perfect 3d stars. This makes the routine much faster, while it  basically
  343.     looks the same.  This is  possible  since  the  stars  are  always  at  a
  344.     constant distance from the camera.
  345.  
  346.     I've also added more macros to the cmul macro.  That  is,  more  multiply
  347.     by constant macros...
  348.  
  349.     Ok people, how come I haven't gotton any postcards yet?  Does nobody read
  350.     this code?  Like, it only cost's 50 some odd cents for a stamp.   I mean,
  351.     tell me what the weather is like where you are, or  something  about  the
  352.     local news events.
  353.  
  354.   Additions for 2.A (hex): Oct 1, '93
  355.  
  356.     Variables xxxfinal[] have been added to the movement/rotate  routines  to
  357.     ensure correct final placement of an object.  This was necessary  due  to
  358.     errors when multiple additions of speed*time did  not  equal  the  actual
  359.     requested final position.  So, every  time  you change  the  anglular  or
  360.     linear velocity, the  variables  final  position  must  be  set  to  tell
  361.     updvectors where that final position is.  If you do not want to calculate
  362.     the final positions yourself, two routines have been supplied  to  do  it
  363.     for you: set_finall - for linear calculations, and set_finala for angular
  364.     calculations.
  365.  
  366.     Added a routine  called  twist_si.   This  sets  the  objects  rotational
  367.     velocity based on a 32 bit input.  Similar to move_si routine.
  368.  
  369.     When  using  twist_si  or  move_si,  try  to   keep   the   time   small.
  370.     eg: <1000 frames.  this will prevent a "jump"  when  the  object  finally
  371.     stops moving/rotating.  if you want large time constants, call set_finall
  372.     or set_finala after calling move_si or twist_si respectivly.   This  will
  373.     re-calculate the final position based on large  time/decimal  error  loss
  374.     and prevent the object from "jumping" at the  end  of  it's  cycle/count.
  375.     OR: call move_si or twist_si in sections, eg call it first as  you  would
  376.     normally (with correct time/distance/angles loaded)  then,  half  way  to
  377.     it's destination, call the routine again (with time/2).  This will re-cal
  378.     the speed better and will also prevent that "jump". (Did you get that?)
  379.  
  380.     We will note that my number (as of Oct 4) gets changed to  the  905  area
  381.     code - (905) 831-1944.
  382.  
  383.     Some routines  added - Point_it,  points object si at  object  di.   This
  384.     only affects the x and y angles, the z angle can still provide spin.
  385.  
  386.     Point_to points object si to location ebx,ecx,ebp
  387.  
  388.     Point_dir routine points object si in the direction it is moving.
  389.  
  390.     Set_speed routine does the opposite of the above routine.   It  sets  the
  391.     speed of the object to the  direction  it  is  pointing.   si  =  object,
  392.     ebp = speed, di = lcount.  (lcount = linear counter, object stops when 0)
  393.  
  394.     Point_time routine points object si to ebx,ecx,ebp in di frames
  395.  
  396.     I managed to get my Suzuki GS1150 up to 240km/hr on the 401 today...
  397.  
  398.   Features added to 2.B: Oct 6, '93
  399.  
  400.     Shading like the pro's:  (Wait a minute, isn't that me?)
  401.  
  402.     Routines added:
  403.  
  404.     pre_cal_lambert   - scan object si and calculate surface normals
  405.     calc_normal       - from 3 points, returns normal vector ebx,ecx,ebp
  406.     lambert           - calculate surface normal rotation maxtrix for object si
  407.     set_up_all_lambert- scans objects from si to di and calls pre_cal_lambert
  408.     lrotate.          - given normal for surface, figures out intensity
  409.  
  410.     I finally bought a book on assembley language today.   God,  there's  all
  411.     kinds of stuff I didn't know this computer can do.  Like xlat...bt...
  412.  
  413.     I've included some old screen set up routines - font.asm and font?.inc
  414.     There not really font routines, just screen setup routines.
  415.  
  416.     Also made the vector sort a little more accurate.
  417.  
  418.   Many, many, many additions for 3.0: Dec 1, '93
  419.  
  420.     THE OBJECT FORMAT HAS BEEN CHANGED!  Changes include addition of 25  words
  421.     at the beginning of the object to accomodate future revisions. But the big
  422.     change is that all points are now point+1.  eg what used to be 0,1,2,0  is
  423.     now 1,2,3,1.  This gives the user access to point 0, which is the  objects
  424.     center of gravity. (point 0,0,0).  The new format for  surface  definition
  425.     is:
  426.  
  427.      dw commands, texture1,texture2,colour1,colour2, connections, [0,0,0]
  428.  
  429.      where the commands determine what the  surface  is,  eg:polygon,  texture,
  430.      bitmap, point, line, along with the  visibility  and  iteration  commands.
  431.      While texture1 and color1 determine what the polygon will look like on the
  432.      first side, txt2 and col2 determine what the other side will look like.
  433.  
  434.     Joystick routines added - see joystick.asm.   The routines use  the  xmode
  435.     font stuff but that could be removed and this code  could  be  transported
  436.     anywhere.
  437.  
  438.     Some optimizations in math.inc (thanks to my new assembler book, Oooo...)
  439.  
  440.     I finally found out how to make a MAKE file.
  441.  
  442.     We will notice my internet access has been corrected.
  443.  
  444.     Optimized/fixed the calc_angles routine (not that you'll care or anything)
  445.  
  446.     Iterations added to objects.  Now object surfaces can have surfaces within
  447.     surfaces within surfaces within surfaces...Example: a building has a  main
  448.     wall with many windows on it, on the windows there is a sign, on the  sign
  449.     there is a bug - if the sign isn't visible, don't plot the bug  -  if  the
  450.     window isn't visible, dont plot the sign (or the bug) - if the  main  wall
  451.     isn't visible, don't plot anything.  This allows objects to be  very  very
  452.     detailed without wasting CPU time.  Iterations save MEGA cpu time!!!
  453.  
  454.     Another sort method has been added - 3d3.asm.  This method uses parts from
  455.     both 3d1.asm and 3d2.asm.  How it  works  -  the  objects  are  sorted  as
  456.     individual objects  until  they  become  close  to  one  another  (set  by
  457.     collision tolerence value) then they get sorted as one object. This allows
  458.     objects to go through one another (and  still  be  sorted  correctly)  yet
  459.     avoids the CPU intensive sorting of hundreds of sides.   If  you  set  the
  460.     tolerence value to 0, the code will run just like 3d1.asm, if you  set  it
  461.     to 1billionx, the code will run like 3d2.asm - somewhere in the middle the
  462.     two sort methods mix.  (Note: 3d1.asm is still the fastest)
  463.  
  464.     A routine has been added to allow the user to scan a file for a "[MARKER]"
  465.     or magic word.  The _findmarker routine scans a file and returns an offset
  466.     (32 bit) in the file as to where the marker was found.  This can  be  used
  467.     to load in mods/gifs and data from the  end  of  the  program  instead  of
  468.     having a seperate data file(s).  This method is similar to the method used
  469.     in demos like UNREAL.EXE and CD2.EXE.  It could also be used to store data
  470.     in or modify the original program. This is not really related to 3d vector
  471.     programming though.
  472.  
  473.     Relative surface colour option can use the  intensity  from  the  previous
  474.     surface.  This relieves the CPU from performing repetative surface  normal
  475.     calculations.  Eg: set the first surface to gourad/lambert shading and set
  476.     all other surfaces with the same normal (angle) to use this intensity. The
  477.     object command to use the previous surface colour is 4096.
  478.  
  479.     Another method for testing if a side is visible has been implemented. Now,
  480.     as well the surface being counter-clockwise, you can also test if  all the
  481.     points are on the screen.  This can be either combined  with  the  counter
  482.     clockwise test or used on it's own.  I don't what good it is yet though...
  483.     Maybe  useful  when  combined  with  iterations?   The  test  works   even
  484.     if a large polygon covers the screen (like the side of a large building)
  485.  
  486.     I have now made 3d1,3d2 and 3d3 all use the same animation format: eg call
  487.     init_tables before an animation then call makeobjs during  the  animation.
  488.     This is the same method for all 3 sorting types.  Although these  routines
  489.     call  different  routines  in  each file, they all end up doing  the  same
  490.     thing.
  491.  
  492.     I actually found a bug in this thing! (yes one little  bug)  -  fixed  the
  493.     arctan function.
  494.  
  495.     Extraced the clipped_line routine so you can use it anywhere. Clipped_line
  496.     routine draws from dx,cx to ax,bx colour bp, but does  it  with  cartesian
  497.     cords - eg 0,0 is screen center,also updates clearing width/height if used
  498.     and clips to borders (of course).
  499.  
  500.     Palette cross referencing option added for each object.  Lets  say  you've
  501.     got 6 spaceships on the screen but you want them each to have a  different
  502.     colour scheme.  Set the offset dword of [palxref]  to  point  to  a  cross
  503.     reference palette.  This way, many on-screen  objects  can  use  the  same
  504.     shape data but each can have a different colour scheme.
  505.  
  506.     I got my 486DX66 today...(Friday Nov 5/93)
  507.  
  508.     Due to popular demand, the camera is now the zero'th  object!!  Therefore,
  509.     all of your objects start a location 1 (1 = 1st object, 2 = 2nd object...)
  510.     The old way had the camera as the last object.  So,  to  move  the  camera
  511.     to location x,y,z in di frames: load up ebx,ecx,ebp as location to move to
  512.     load di with time to get there, load si  =  0  (cameraobject=0)  and  call
  513.     move_si.
  514.  
  515.     The vector matricies have been truncated to 16  bits  from  32  bits.  The
  516.     accuracy of the code however, remains the same as before.
  517.  
  518.     Small, tini-weeni bug fixed in polyfill.  I am no longer using  doubleword
  519.     transfers to the VGA.  This  should  stop  people  having  their  monitors
  520.     destroyed - (just kidding)  It removes those eggs.
  521.  
  522.     And yet another option! 1/4 scaled fuzzy bitmaps (for  lack  of  a  better
  523.     name). These are scalable, non-rotatable bitmaps just like the ones you've
  524.     seen before (option 32) but only every 4'th pixel is  sampled.   This  has
  525.     the advantage of faster plotting of bitmaps that don't require  a  lot  of
  526.     accuracy - like explosions and smoke.  To invoke this new type of  bitmap,
  527.     just use option 33 (32+1) in either the object definition or in userotate.
  528.     (note: if used in object, bitmap is part of object. if used in  userotate,
  529.     entire object is one big bitmap - like I said, good for explosions)
  530.  
  531.     Holly Kamolly, this thing is getting big...
  532.  
  533.     All surface/polygon options have now been set to defines.  Look in the equ
  534.     file to see what options there are.  This now replaces using 512+256+2+...
  535.     in your object.  (makes understanding them easier)  The new defines are:
  536.  
  537.     excerpt from equ.inc: current list of commands and texture options
  538.  
  539.       ; texture options (texture1&2)
  540.       wavey    equ 1       ; sine wave surface
  541.       shade    equ 2       ; lambert shaded surface
  542.       inverse  equ 4       ; inverse shading
  543.       glow     equ shade+inverse
  544.       last     equ 8       ; colour is same intensity as previous surface
  545.       texture  equ 16      ; texture mapped surface
  546.  
  547.       ; surface types   (command)
  548.       point    equ 32      ; surface is a point
  549.       line     equ 64      ; surface is a line
  550.       himap    equ 128     ; scalable, non-rotatable, hi quality bitmap
  551.       lomap    equ himap+1 ; scalable, non-rotatable, lo quality bitmap
  552.  
  553.       ; surface commands(command)
  554.       iterate  equ 256     ; generate iteration below if side visible
  555.  
  556.       ; visibility determination methods (command)
  557.       both     equ 1       ; always visible, no matter side
  558.       double   equ 2       ; double sided surface, other side has texture2 and colour2
  559.       onscr    equ 4       ; is polygon on screen?
  560.       check    equ 8       ; check if polygon is on screen/counter-clockwise, but don't plot
  561.  
  562.      to be used in the format:
  563.  
  564.      dw commands,texture1,texture2,colour1,colour2, connections, [0,0,0]
  565.  
  566.    The objects now have user-difinable resolutions.  Look at the objects.inc
  567.    file to see how I have implemented this.  The first dd is the  resolution
  568.    at which the next offset  is  visible  at.   Successive  resolutions  are
  569.    visible  at farther distances.  The only object I have  implemented  with
  570.    a different resolution is that bitmapped cube thingy.  Notice as it  gets
  571.    farther away, the chrome balls turn into single pixels.   The  end  flag
  572.    for "this is the last resolution" is -1.
  573.  
  574.   Version 3.1:Texture mapping, PCX decoding, object Hierarchy, real time  irq
  575.               palette fading, superfast log table multiply, joystick routines
  576.  
  577.